<?php $this->renderPartial('index'); ?>

<table class="dataGrid">
  <tr>
    <th>id</th>
    <th>Name</th>
    <th>Base premissions</th>
    <th>Actions</th>
  </tr>

<?php foreach($roles as $n => $role): ?>
	<tr class="<?php echo (($n & 1) == 0) ? 'even' : 'odd' ; ?>">
		<td><?php echo $role->id; ?></td>
		<td><?php echo CHtml::image('/images/'.$role->name.'.png', $role->name), ' ', $role->name; ?></td>
		<td><?php echo str_pad(dechex($role->base_permissions), 16, '0', STR_PAD_LEFT); ?></td>
		<td>
			<?php echo CHtml::imageLink('/admin/role/edit/'.$role->id, '/images/edit.png'); ?>
		</td>
	</tr>
<?php endforeach; ?>

</table>
